/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bus;

import dao.AccountDAO;
import dto.AccountDTO;
import java.util.ArrayList;

/**
 * Account BUS
 * @author Hung Cuong <nhc.hcmuns at gmail.com>
 */
public class AccountBUS {
    private AccountDAO _Dao = new AccountDAO();

    /**
     * Insert account
     * @param acc
     */
    public void insertAccount(AccountDTO acc) {
        _Dao.insert(acc);
    }

    /**
     * Update account
     * @param acc
     */
    public void updateAccount(AccountDTO acc) {
        _Dao.update(acc);
    }

    /**
     * Delete account
     * @param acc
     */
    public void deleteAccount(AccountDTO acc) {
        _Dao.delete(acc);
    }

    /**
     * Get all accounts
     * @return
     */
    public ArrayList<AccountDTO> getAllRecords() {
        return _Dao.getAllRecords();
    }

    /**
     * Get account information
     * @param accId
     * @return
     */
    public AccountDTO getInfo(int accId) {
        return _Dao.getInfo(accId);
    }
}
